package oop5;

import oop4.Dog;
import oop4.Pet;
import org.omg.CORBA.TIMEOUT;

/**
 * @author oldliu
 * @since 1.0
 */
public class PetDoctor2 {
    private String name;
    public PetDoctor2(String n){
        this.name=n;
    }

    /**
     * 给宠物治病，假如是Tiger，把嘴给捆上！
     * @param pet
     */
    public void cure(Pet pet){
        pet.print();
        System.out.println(name+"给"+pet.getName()+"看病");
        boolean pd=pet instanceof Tiger;
        if (pd){
            System.out.println("嘴捆上");
        }
        if(pet.getHealth()>60){
            System.out.println("没病，走两步！");
            return;
        }
        while (pet.getHealth()<95){
            System.out.println("打针吃药，慢慢恢复");
            pet.setHealth(pet.getHealth()+5);
        }
        System.out.println("医生"+name+"把"+pet.getName()+"治好了！");
    }
    //宠物医生给人看病!重载！！！
    public void cure(Ren ren){
        System.out.println(this.name+"在给"+ren.getName()+"看病");
        System.out.println(this.name+"说:\"你没病，走两步\"");
    }
}
